package com.guigu.qingcheng.mapper;

import com.guigu.qingcheng.pojo.TbSpec;
import com.guigu.qingcheng.pojo.vo.ParaVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface TbSpecMapper extends Mapper<TbSpec> {

    List<ParaVo> ParaPageQueryByAll(@Param("pageNum") Integer pageNum,@Param("pageSize") Integer pageSize,@Param("tbSpec") TbSpec tbSpec);


    Long ParaPageQueryByAlltotal(TbSpec tbSpec);

    //根据商品分类查询分类列表
    @Select("SELECT name,options FROM tb_spec WHERE template_id IN (SELECT template_id FROM tb_category WHERE NAME=#{name}) ORDER BY seq")
    List<Map> findListByCategoryName(@Param("name") String name);
}